//
//  CustomCellMaker.m
//  TuiTe
//
//  Created by 张 霄鹤 on 10-4-21.
//  Copyright 2010 xhzhang. All rights reserved.
//

#import "CustomCellMaker.h"


@implementation CustomCellMaker

+ (void)makeCustomCellWithType:(NSInteger)type toCell:(UITableViewCell *)cell{
	switch (type) {
		case CELL_TWEET:
			[CustomCellMaker makeTweetCell:cell];
			break;
		case CELL_USER:
			[CustomCellMaker makeUserCell:cell];
			break;
		default:
			break;
	}
}

+ (void)makeTweetCell:(UITableViewCell *)cell{
	// CGFloat cw = cell.frame.size.width;
	
	UILabel *lblName;
	UIImageView *imageView;
	UILabel *lblDate;
	UILabel *lblTweet;
	//UIImageView *favImageView;
	imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 44, 44)];
	imageView.tag = 0;
	imageView.autoresizingMask = UIViewAutoresizingFlexibleRightMargin; // | UIViewAutoresizingFlexibleHeight;
	UIView *view = cell.contentView;
	imageView.opaque = YES;
	imageView.backgroundColor = [UIColor clearColor];
	[view addSubview:imageView];
	[imageView release];
	
	lblName = [[UILabel alloc] initWithFrame:CGRectMake(62, 0, 100,19)];
	lblName.tag = 1;
	lblName.font = [UIFont systemFontOfSize:16.0];
	lblName.textAlignment = UITextAlignmentLeft;
	lblName.textColor = [UIColor blackColor];
	lblName.autoresizingMask = UIViewAutoresizingFlexibleRightMargin; // | UIViewAutoresizingFlexibleHeight;
	lblName.opaque = YES;
	lblName.backgroundColor = [UIColor clearColor];
	[view addSubview:lblName];
	[lblName release];
	
	//favImageView = [[UIImageView alloc] initWithFrame:CGRectMake(180, 0, 20,19)];
//	favImageView.tag = 4;
//	favImageView.opaque = YES;
//	[view addSubview:favImageView];
//	[favImageView release];
	
	lblDate = [[UILabel alloc] initWithFrame:CGRectMake(180, 0, 80,19)];
	lblDate.tag = 2;
	lblDate.font = [UIFont systemFontOfSize:16.0];
	lblDate.textAlignment = UITextAlignmentRight;
	lblDate.textColor = [UIColor blackColor];
	lblDate.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin ; // | UIViewAutoresizingFlexibleHeight;
	lblDate.opaque = YES;
	lblDate.backgroundColor = [UIColor clearColor];
	[view addSubview:lblDate];
	[lblDate release];
	
	lblTweet = [[UILabel alloc] initWithFrame:CGRectMake(62, 28, 220, 60)];
	lblTweet.tag = 3;
	lblTweet.font = [UIFont systemFontOfSize:16.0];
	lblTweet.textAlignment = UITextAlignmentLeft;
	lblTweet.textColor = [UIColor blackColor];
	lblTweet.autoresizingMask = UIViewAutoresizingFlexibleRightMargin; // | UIViewAutoresizingFlexibleHeight;
	lblTweet.lineBreakMode = UILineBreakModeCharacterWrap;
	lblTweet.numberOfLines = 8;
	lblTweet.opaque = YES;
	lblTweet.backgroundColor = [UIColor clearColor];
	[view addSubview:lblTweet];
	[lblTweet release];
}

+ (void)makeUserCell:(UITableViewCell *)cell{

}

@end
